package com.deepocean.service.impl;

import com.deepocean.dao.TBSDao;
import com.deepocean.entity.TeeterBedSeparatorCondition;
import com.deepocean.entity.TeeterBedSeparatorEntity;
import com.deepocean.entity.TeeterBedSeparatorInAndOut1Hour;
import com.deepocean.service.ITBSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class TBSServiceImpl implements ITBSService {
    @Autowired
    TBSDao tbsDao;
    @Override
    public boolean add(TeeterBedSeparatorEntity teeterBedSeparatorEntity) {
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        teeterBedSeparatorEntity.setId(id);
        return tbsDao.add(teeterBedSeparatorEntity);
    }

    @Override
    public TeeterBedSeparatorInAndOut1Hour getInAndOutInHour(String deviceId) {
        return tbsDao.getInAndOutInHour(deviceId);
    }

    @Override
    public List<TeeterBedSeparatorEntity> getTBSCondition(TeeterBedSeparatorCondition teeterBedSeparatorCondition) {
        return tbsDao.getTBSByCondition(teeterBedSeparatorCondition);
    }
}
